#include "super_tool/include/super_tool_util.h"
#include "super_tool/include/super_tool.h"
#include <iostream>

class MyCallback : public supertool::WsCallback {

public:
    void OnMessage(supertool::MessageInfo response) {
        std::cout << supertool::SuperToolUtil::getCurrentTime() << " 收到回调结果: " << response.cmdType << ", "
                  << response.param << std::endl;
    };
};

int main() {
    supertool::SuperTool &singleton = supertool::SuperTool::getInstance();
//    int32_t interval = 1;
//    singleton.set_callbackInterval(interval);
//    std::shared_ptr<MyCallback> myCallback(new MyCallback);
    auto myCallback = make_shared<MyCallback>();
    singleton.set_callback(myCallback);
    singleton.init();
    while (true); // 主线程持续运行
    return 0;
}